#!/usr/bin/env bash
# encoding: utf-8.0

joinByChar() {
  local IFS="$1"
  shift
  echo "$*"
}

while read srcline
do
  #echo "d: ${srcline}"
  IFS=':' read -r -a array <<< "$srcline"
  version=${array[-1]};
  unset array[-1]
  arti=${array[-1]};
  unset array[-1]
  groupId=${array[-1]};
  unset array[-1]
  echo -e "        <dependency>\n            <groupId>${groupId}</groupId>\n            <artifactId>${arti}</artifactId>\n            <version>${version}</version>\n        </dependency>"
done < $1
